<title>表单组合</title>
<style>


</style>
<div class="layui-card layadmin-header" style="height: 50px; line-height: 50px;">
	<div class="layui-breadcrumb" lay-filter="breadcrumb" style="padding: 0 15px;">
		<a lay-href="">商家中心</a>
		<a><cite>发布推广任务</cite></a>
	</div>
</div>

<script type="text/html" template>
<div class="layui-fluid jetee">
	<div class="layui-card">
		<h3 class="layui-card-header">发布推广任务-第三步 设置如何找到商品</h3>
		<div class="layui-card-body" style="padding: 15px;">
			<div class="layui-row">
				<div class="layui-col-lg10">

					<form class="layui-form" action="" lay-filter="LAY-user-back-manage" onsubmit="return false;">
						<div class="layui-form-item">
							<label class="layui-form-label"><span class="layui-badge">必填</span> 定位目标商品排序</label>
							<div class="layui-input-block">
								{{#  layui.each([0,1,2,3,4,5,6,7,8,9,10], function(k, v){ }}
									{{#  if(layui.je_task_add[1].mall_id == v){ }}
										{{#  layui.each(lang1['sortstyle'][v], function(index, item){ }}
											<input type="radio" name="sortstyle" value="{{ index }}" title="{{ item }}">
										{{#  }); }}
									{{#  } }}
								{{#  }); }}
								<br/>
								务必亲自在手机端搜索，确保正确性
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"><span class="layui-badge">必填</span> 手机搜索页展示价格</label>
							<div class="layui-input-block layui-font-gray">
								<input type="number" name="listprice" lay-verify="number" placeholder="手机搜索页展示价格"  step="0.1" class="layui-input">
								务必亲自在手机端搜索，确认价格准确
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"><span class="layui-badge">必填</span> 商品评论星级</label>
							<div class="layui-input-block layui-font-gray">
								<input type="number" name="commentstar" lay-verify="number" placeholder="商品评论星级"  step="0.1" class="layui-input">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"><span class="layui-badge">必填</span> 商品现有评价数约</label>
							<div class="layui-input-block layui-font-gray">
								<input type="number" name="commentnum" lay-verify="number" placeholder="商品现有评价数约"  step="1" class="layui-input">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"><span class="layui-badge">必填</span> 是否允许筛选</label>
							<div class="layui-input-block layui-font-gray">
								<input type="radio" name="isfilter" value="0" title="{{ lang1['no'] }}">
								<input type="radio" name="isfilter" value="1" title="{{ lang1['yes'] }}">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label">设置优惠券</label>
							<div class="layui-input-block layui-font-gray">
								<input type="radio" name="iscoupon" value="0" title="{{ lang1['no'] }}">
								<input type="radio" name="iscoupon" value="1" title="{{ lang1['yes'] }}">
							</div>
						</div>

						<input type="hidden" name="id" value="{{ layui.je_task_add[0].id }}">

						<div class="layui-form-item">
							<div class="layui-input-block">
								<div class="layui-footer">
									<button class="layui-btn" onclick="layui.common.go('/task/add2')" type="button">上一步</button> <button class="layui-btn" lay-submit="" lay-filter="component-form-demo1" type="button">下一步</button>
								</div>
							</div>
						</div>
					</form>

				</div>
			</div>
		</div>
	</div>
</div>
</script>

<script>
layui.use(['admin', 'form', 'laydate'], function(){
	var $ = layui.$
	,admin = layui.admin
	,layer = layui.layer
	,form = layui.form
	,view = layui.view
	,je=layui.common;
	if(!layui.je_task_add){
		//从本地取
		layui.je_task_add=je.storage('je_task_add');
	}
	setTimeout(function(){
		//重载
		if(layui.je_task_add[3]){
			//表单重载值
			form.val("LAY-user-back-manage",layui.je_task_add[3]);
		}
		form.render(null, 'LAY-user-back-manage');
	},100);



	/* 提交 */
	form.on('submit(component-form-demo1)', function(data){
		let field=data.field;
		//生成临时信息记录
		admin.req({
			url: './task/add3'
			,type: 'post'
			,data:field
			,done: function(res){
				delete field.access_token;
				layui.je_task_add[0].step=3;
				layui.je_task_add[0].maxstep>3 ? '' : layui.je_task_add[0].maxstep=3;
				layui.je_task_add[3]=field;
				je.storage('je_task_add',layui.je_task_add);
				//跳转到下一步
				location.hash = '/task/add4';
			}
			,loading:true
		});

		return false;
	});

});
</script>